What is @golevelup/nestjs-discovery?
@golevelup/nestjs-discovery is a utility library for the NestJS framework that provides tools for discovering and interacting with providers, controllers, and other components within a NestJS application. It simplifies the process of dynamically finding and using these components.
What are @golevelup/nestjs-discovery's main functionalities?
Discover Providers
This feature allows you to discover all providers that have a specific metadata key. This can be useful for dynamically interacting with certain providers based on custom metadata.
const providers = await discoveryService.providersWithMetaAtKey('someMetaKey');
Discover Controllers
Similar to discovering providers, this feature lets you find all controllers that have a specific metadata key. This can be useful for dynamically routing or handling requests based on controller metadata.
const controllers = await discoveryService.controllersWithMetaAtKey('someMetaKey');
Discover Methods
This feature allows you to discover all methods within your application that have a specific metadata key. This can be useful for dynamically invoking methods or applying certain behaviors based on method metadata.
const methods = await discoveryService.methodsWithMetaAtKey('someMetaKey');
Other packages similar to @golevelup/nestjs-discovery
nestjs-query
nestjs-query is a package that provides a set of tools for building GraphQL and REST APIs with NestJS. It offers features like automatic CRUD operations and filtering, which can be compared to the dynamic discovery and interaction capabilities of @golevelup/nestjs-discovery.